yield Scripting.destroyTestWindows();
for (let k = 0; k < config.count; k++)
- yield Scripting.createTestWindow(config.width, config.height, config.alpha, config.maximized);
+ yield Scripting.createTestWindow({ width: config.width,
+ height: config.height,
+ alpha: config.alpha,
+ maximized: config.maximized });
yield Scripting.waitTestWindows();
yield Scripting.sleep(1000);
const Shell = imports.gi.Shell;
const Main = imports.ui.main;
+const Params = imports.misc.params;
// This module provides functionality for driving the shell user interface
// in an automated fashion. The primary current use case for this is
/**
* createTestWindow:
- * @width: width of window, in pixels
- * @height: height of window, in pixels
- * @alpha: whether the window should be alpha transparent
+ * @params: options for window creation.
+ * width - width of window, in pixels (default 640)
+ * height - height of window, in pixels (default 480)
+ * alpha - whether the window should have an alpha channel (default false)
+ * maximized - whether the window should be created maximized (default false)
* @maximized: whethe the window should be created maximized
*
* Creates a window using gnome-shell-perf-helper for testing purposes.
* because of the normal X asynchronous mapping process, to actually wait
* until the window has been mapped and exposed, use waitTestWindows().
*/
-function createTestWindow(width, height, alpha, maximized) {
+function createTestWindow(width, height, params) {
+ params = Params.parse(params, { width: 640,
+ height: 480,
+ alpha: false,
+ maximized: false });
+
let cb;
let perfHelper = _getPerfHelper();
- perfHelper.CreateWindowRemote(width, height, alpha, maximized,
+ perfHelper.CreateWindowRemote(params.width, params.height,
+ params.alpha, params.maximized,
function(result, excp) {
if (cb)
cb();